from django.contrib import admin
from ponyfolio.models import SiteMeta, Gig, Screenshot, ContactInfo

class SiteMetaAdmin(admin.ModelAdmin):
    list_filter = ('site',)
    list_display = ('site', 'title', 'tagline', 'keywords', 'footer')
    search_fields = ('title', 'description', 'keywords', 'footer')
    ordering = ('site', )    
    
admin.site.register(SiteMeta, SiteMetaAdmin)


class ScreenshotInline(admin.TabularInline):
    model = Screenshot
    
class GigAdmin(admin.ModelAdmin):
    list_filter = ('sites',)
    list_display = ('title', 'active',)
    search_fields = ('title', 'description',)
    ordering = ('title', )    
    inlines = [ScreenshotInline,]
admin.site.register(Gig, GigAdmin)


class ScreenshotAdmin(admin.ModelAdmin):
    list_filter = ('gig',)
    list_display = ('gig', 'title', 'file', 'active',)
    search_fields = ('title', 'description',)
    ordering = ('gig', )    
    
admin.site.register(Screenshot, ScreenshotAdmin)

class ContactInfoAdmin(admin.ModelAdmin):
    list_filter = ('site',)
    list_display = ('email', 'phone', 'skype', 'facebook')
    search_fields = ('email', 'phone',)
    ordering = ('site', )    
    
admin.site.register(ContactInfo, ContactInfoAdmin)